
// function out(e) {
// 	var x=e.clientX;
// 	var y=e.clientY;
// 	console.log(x+","+y);

// }
var c=document.getElementById("zbx");
var fx=document.getElementById("x");

var addx=Number(c.width)/2;
var addy=Number(c.height)/2;
var cxt=c.getContext("2d");



function x_and_y(argument) {	
	cxt.moveTo(0, addy);
	cxt.lineTo(addx*2, addy);
	cxt.moveTo(addx,0);
	cxt.lineTo(addx, addy*2);
	cxt.stroke();
}

function num(){
	cxt.font = "10px Arial";
	cxt.strokeText(5, addx+5, addy+20);
	cxt.beginPath();
	cxt.strokeText(1, addx, addy+20);
	}

function fun_img(argument) {
	cxt.fillStyle="#ffffff";
	var bl=10/(addx+10);
	for(var x=-2*addx;x<2*addx;x=x+bl){

		var x1=x+addx;
		var y=-(x*x)+addy;
		if(2*addx>225){
		cxt.arc(x1,y,2,0,Math.PI*2,true);
				}
				else{
					cxt.arc(x1,y,1,0,Math.PI*2,true);
				}
				cxt.closePath();
		console.log(1);

	}
	console.log("完成")

	cxt.fill();

	cxt.closePath();
}

function fre_x(){
	c.width=fx.value;
	addx=Number(c.width)/2;
	x_and_y();
	num();
	fun_img();
}
x_and_y();
num();
fun_img();